package com.gdufe.user.mq;

import com.gdufe.common.entity.OrderEntity;
import com.gdufe.common.vo.AddPointsVo;
import com.gdufe.user.service.UserClientService;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(nameServer = "${rocketmq.name-server}",topic = "uppoint",
        consumerGroup = "mall-user",messageModel = MessageModel.BROADCASTING)
public class UserMQListener implements RocketMQListener<AddPointsVo> {
    @Autowired
    UserClientService userClientService;

    @Override
    public void onMessage(AddPointsVo addPointsVo) {
        userClientService.addPoints(addPointsVo);

    }
}
